﻿<%@ Page Title="" Language="C#" MasterPageFile="~/OrderSite.master" AutoEventWireup="true" CodeBehind="RawMaterialOrderDeliveries.aspx.cs" Inherits="XYZ_Inventory.RawMaterialOrderDeliveries" %>
<asp:Content ID="Content1" ContentPlaceHolderID="htmlHead" runat="server">
    <link href="Styles/GridView.css" rel="stylesheet" type="text/css"/>
    <link href="Styles/ValidationSummary.css" rel="stylesheet" type="text/css"/>
    <link href="Styles/CustomTable.css" rel="stylesheet" type="text/css"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <fieldset style="margin: 0.5em; padding: 0.5em;">
        <legend>Raw Material Order Delivery </legend>
        <div class="gridViewContainer" style="float: left;">
            <asp:GridView ID="GridView1" CssClass="gridView" runat="server" AutoGenerateColumns="False"
                          CellPadding="4" ForeColor="#333333" GridLines="None"
                          AllowPaging="True" DataKeyNames="ID"
                          OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing"
                          OnRowUpdating="GridView1_RowUpdating" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                          OnPageIndexChanging="GridView1_PageIndexChanging"
                          onselectedindexchanging="GridView1_SelectedIndexChanging">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775"/>
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="Order ID" ReadOnly="True">
                        <ItemStyle HorizontalAlign="Right"/>
                    </asp:BoundField>
                    <asp:BoundField DataField="OrderDate" HeaderText="Ordered Date" ReadOnly="True" DataFormatString="{0:d}"/>
                    <asp:BoundField DataField="RawMaterialName" HeaderText="Material Name" ReadOnly="True"/>
                    <asp:TemplateField HeaderText="Quantity">
                        <ItemTemplate>
                            <%# Eval("Quantity") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>' min="1"
                                         Width="100" TextMode="Number">
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtQuantity"
                                                        ErrorMessage="Quantity is required." Text="*" ForeColor="Red" Display="Dynamic"
                                                        ValidationGroup="Edit">
                            </asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemStyle HorizontalAlign="Right"/>
                    </asp:TemplateField>
                    <asp:BoundField DataField="SupplierID" HeaderText="Supplier ID" ReadOnly="True">
                        <ItemStyle HorizontalAlign="Right"/>
                    </asp:BoundField>
                    <asp:CommandField HeaderText="Action" ShowSelectButton="True" ValidationGroup="Edit"
                                      ShowEditButton="True"/>
                </Columns>
                <EditRowStyle BackColor="#999999"/>
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"/>
                <SortedAscendingCellStyle BackColor="#E9E7E2"/>
                <SortedAscendingHeaderStyle BackColor="#506C8C"/>
                <SortedDescendingCellStyle BackColor="#FFFDF8"/>
                <SortedDescendingHeaderStyle BackColor="#6F8DAE"/>
            </asp:GridView>
            <asp:ValidationSummary ID="ValidationSummary2" Style="margin-top: 1em;" CssClass="validationSummary"
                                   HeaderText="<b>Please fix following error(s):</b>" ValidationGroup="Edit" ForeColor="Red"
                                   runat="server"/>
        </div>
        <table class="table" id="tblCheckIn" style="float: left; padding-left: 1em;" runat="server">
            <tr>
                <th colspan="2">
                    Check in deliveries
                </th>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Order ID"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtOrderId" runat="server" Width="75" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Unorder Item Quantity"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtUOQty" runat="server" Width="75" TextMode="Number"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Mistake Count:"></asp:Label>
                    <br/>
                    <br/>
                    <asp:RadioButton ID="rdOverCount" runat="server" Text="Over count" GroupName="Count"
                                     Checked="True"/>
                    <br/>
                    <asp:RadioButton ID="rdUnderCount" runat="server" Text="Under Count" GroupName="Count"/>
                </td>
                <td>
                    <asp:TextBox ID="txtMistakeCount" runat="server" Width="75" TextMode="Number"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label4" runat="server" Text="Damage Item Count"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtDamageCount" Width="75" TextMode="Number" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="background-color: #E2DED6; color: #284775;">
                    <asp:Button ID="btnDelivered" runat="server" Text="Mark as delivered" Enabled="False"
                                OnClick="btnDelivered_Click"/>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="background-color: #E2DED6; color: #284775;">
                    <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
                </td>
            </tr>
        </table>
    </fieldset>
</asp:Content>